import service from "@/api/index.js";
import qs from "qs";
const adminApi = {
    //获取验证码
    captcha(){
        return service.get("/admin/captcha")
    },
    //登录
    login(admin){
        return service.post("/admin/login",qs.stringify(admin));
    },
    //获取已登录信息
    getInfo(){
        return service.get("/admin/info")
    },
    //修改密码
    chgPwd(chgPwdObj){
        return service.put("/admin/chgPwd",qs.stringify(chgPwdObj))
    },
    //修改信息
    chgInfo(admin){
        return service.put("/admin/chgInfo",admin)
    },
    //查询所有管理员信息
    selectAll(){
        return service.get("/admin");
    },
    //添加管理员
    insert(admin){
        return service.post("/admin",admin)
    },
    //重置密码
    resetPassword(admin){
        return service.put("/admin/password",admin)
    },
    //修改状态
    updateStatus(admin){
        return service.put("/admin/status",admin)
    },
    selectCategoryTop5(){
        return service.get("/admin/top5")
    },
    selectOrderByDay(){
        return service.get("/admin/orderToday")
    }
};
export default adminApi;